<include file="Public:header" />
<div class="container main"> <include file="Public:left" />
  <div class="w790">
  <div class="h"><a href="{:U('Role/index')}" class="btn btn-info"><i class="glyphicon glyphicon-circle-arrow-left"></i> 返回角色列表</a>

 </div>


  <form class="checkoutform" action="{:U('update')}" method="post"><input name="role_id" type="hidden" value="{$role.id}" />
     <table class="table table-bordered" width="100%" border="0" cellspacing="0" cellpadding="0">
     
     <caption style="text-align:center; font-size:20px;">
    为【{$role.name}】授权
  </caption>
     
     
<volist name="all_node" id="vo">
  <tr>
    <td align="center"><input <eq name="vo['role_id']" value="$role['id']">checked="checked"</eq> type="checkbox" name="node_id[]" id="node_id[]" class="sall" value="{$vo.id}_{$vo.level}" />
     <!-- {$vo.name}-->[{$vo.title}]</td>
    <td><table class="table table-bordered" width="100%" border="0" cellspacing="0" cellpadding="0">
    <volist name="vo['sub']" id="svo">
      <tr>
        <td align="left"><input type="checkbox" onClick="selectsub(this);"  <eq name="svo['role_id']" value="$role['id']">checked="checked"</eq> name="node_id[]" id="node_id[]" class="sall" value="{$svo.id}_{$svo.level}" /> <!--{$svo.name}-->[{$svo.title}]</td>
        <td>
          <volist name="svo['sub']" id="ssvo">
            <span style="display:inline-block; padding:5px">
          <input type="checkbox"  <eq name="ssvo['role_id']" value="$role['id']">checked="checked"</eq> name="node_id[]" id="node_id[]" class="sall" value="{$ssvo.id}_{$ssvo.level}" /> <!--{$ssvo.name}-->[{$ssvo.title}]
            </span></volist>
       </td>
        </tr>
        </volist>
    </table></td>
    </tr>
 </volist>
<div class="pages"><button type="submit" class="btn btn-success">保存</button></div>
</table>
</form>
<style>

</style>
  </div>
  <div class="clear"></div>
</div>

<script>
    function selectsub(e){
		if($(e).prop('checked')== true){
			$(e).parent().parent().find('input').prop('checked',true);
		}else{
			$(e).parent().parent().find('input').prop('checked',false);
		}
	}
</script>
<include file="Public:footer" />